#include "PinDebouncer.h"

int globalPushButtonPin = 8;
unsigned long globalMinimumTimeBetweenDebounceSamplesUs = 20;
const unsigned int globalDebounceFilterBufferArraySize = 8;
unsigned char globalDebounceFilterBufferArray[globalDebounceFilterBufferArraySize];

PinDebouncer
	pd(
		globalPushButtonPin,
		globalMinimumTimeBetweenDebounceSamplesUs,
		globalDebounceFilterBufferArray,
		globalDebounceFilterBufferArraySize);

void setup()
{
	pinMode(13, OUTPUT);	// LED 'L'
}

void loop()
{
	pd.Service();
	
    switch(pd.GetPinState())
    {
      case HIGH:
        {
          digitalWrite(13, HIGH);
        }
        break;
      case LOW:
      	{
          digitalWrite(13, LOW);
        }
        break;
      default:
        {
          digitalWrite(13, LOW);
        }
        break;
    }
}

